<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>get_rectangle_pose [HALCON算子参考手册]</title>
<style type="text/css">
      body {
    color: #000000;
    background-color: #ffffff;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.body_main {
    margin-left: 35px;
    margin-right: 35px;
}

@media screen and (min-width:992px) {

    .body_main {
        margin-left: 10%;
        margin-right: 10%;
    }

    table.toctable {
        width: 80%
    }
}

@media screen and (min-width:1400px) {

    .body_main {
        margin-left: 15%;
        margin-right: 15%;
    }

    table.toctable {
        width: 70%
    }
}

body>div ul ul {
    margin-left: inherit;
}

a:link {
    color: #0044cc;
}

a:link,
a:visited {
    text-decoration: none;
}

a:link:hover,
a:visited:hover {
    text-decoration: underline;
}

th {
    text-align: left;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-rendering: optimizeLegibility;
    color: #666666;
}

code {
    font-family: monospace,monospace;
}

h1 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

h2 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

hr {
    border: 0;
    border-top: solid 1px #f28d26;
}

.pre {
    display: block;
    padding-bottom: 1ex;
    font-family: monospace;
    white-space: pre;
}

pre {
    font-family: monospace, monospace;
    padding: 1ex;
    white-space: pre-wrap;
}

.toc {
    font-size: 80%;
    border-top: 1px dashed #f28d26;
    border-bottom: 1px dashed #f28d26;
    padding-top: 5px;
    padding-bottom: 5px;
}

.inv {
    margin: 0;
    border: 0;
    padding: 0;
}

.banner {
    color: #666666;
    padding-left: 1em;
}

.logo {
    background-color: white;
}

.keyboard {
    font-size: 80%;
    padding-left: 3px;
    padding-right: 3px;
    border-radius: 5px;
    border-width: 1px;
    border-style: solid;
    border-color: #f28d26;
    background-color: #f3f3f3;
}

.warning {
    margin-top: 2ex;
    margin-bottom: 1ex;
    padding: 10px;
    text-align: center;
    border: 1px solid;
    color: #bb0000;
    background-color: #fff7f7
}

.imprint {
    margin-top: 1ex;
    font-size: 80%;
    color: #666666;
}

.imprinthead {
    font-weight: bolder;
    color: #666666;
}

.indexlink {
    text-align: right;
    padding-bottom: 5px;
}

.postscript {
    margin-top: 2ex;
    font-size: 80%;
    color: #666666
}

.evenrow {
    background-color: #e7e7ef;
    vertical-align: top;
}

.oddrow {
    background-color: #f7f7ff;
    vertical-align: top;
}

.headrow {
    background-color: #97979f;
    color: #ffffff;
    vertical-align: top;
}

.logorow {
    vertical-align: top;
}

.error {
    color: red;
}

.var {
    font-style: italic
}

.halconoperator {
    font-family: monospace, monospace;
}

span.operator {
    font-family: monospace, monospace;
}

span.procedure {
    font-family: monospace, monospace;
}

span.operation {
    font-family: monospace, monospace;
}

span.feature {
    font-family: Arial, Helvetica, Homerton, sans-serif;
}

ul {
    padding-left: 1.2em;
}

li.dot {
    list-style-type: square;
    color: #f28d26;
}

.breadcrumb {
    font-size: 80%;
    color: white;
    background-color: #062d64;
    margin-bottom: 20px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 15px;
}

.webbar {
    font-size: 80%;
    background-color: #dddddd;
    margin-top: 0px;
    margin-left: -35px;
    margin-right: -35px;
    margin-bottom: 0px;
    padding-top: 5px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 5px;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-top: 1px dashed #f28d26;
    font-size: 80%;
    color: #666666;
    padding-bottom: 8px;
}

.footer .socialmedia a {
    padding-left: 7px;
}

.socialmedia {
    padding-top: 10px;
}

.copyright {
    margin-top: 19px;
}

.breadcrumb a {
    color: #ffffff;
    border-bottom: 1px solid white;
}

.breadcrumb a:link:hover,
.breadcrumb a:visited:hover {
    text-decoration: none;
    border-bottom: none;
}

.heading {
    margin-top: 1ex;
    font-size: 110%;
    font-weight: bold;
    color: #666666;
}

.text {
    color: black;
}

.example {
    font-size: 80%;
    background-color: #f3f3f3;
    border: 1px dashed #666666;
    padding: 10px;
}

.displaymath {
    display: block;
    text-align: center;
    margin-top: 1ex;
    margin-bottom: 1ex;
}

.title {
    float: left;
    padding-top: 3px;
    padding-bottom: 3px;
}

.signnote {
    font-family: Arial, Helvetica, Homerton, sans-serif;
    font-size: 80%;
    color: #666666;
    font-weight: lighter;
    font-style: italic
}

.par {
    margin-bottom: 1.5em;
}

.parhead {
    text-align: right;
}

.parname {
    float: left;
}

.pardesc {
    font-size: 85%;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 2em;
}

.parcat {
    color: #666;
    font-weight: bold;
}

*[data-if=cpp],
*[data-if=c],
*[data-if=dotnet],
*[data-if=com],
*[data-if=python] {
    display: none;
}

.tabbar {
    text-align: right;
    border-bottom: 1px solid #f28d26;
    margin-bottom: 0.5em;
}

ul.tabs {
    padding-top: 3px;
    padding-bottom: 3px;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 80%
}

ul.tabs li {
    padding-top: 3px;
    padding-bottom: 3px;
    display: inline;
    overflow: hidden;
    list-style-type: none;
    margin: 0;
    margin-left: 8px;
    border-top: 1px solid #666;
    border-left: 1px solid #666;
    border-right: 1px solid #666;
}

ul.tabs li.active {
    border-left: 1px solid #f28d26;
    border-right: 1px solid #f28d26;
    border-top: 1px solid #f28d26;
    border-bottom: 1px solid #fff;
}

ul.tabs li.inactive {
    background-color: #eee;
}

ul.tabs li a {
    padding-left: 5px;
    padding-right: 5px;
    color: #666;
}

ul.tabs li a:link:hover {
    text-decoration: none;
}

ul.tabs li.inactive a {
    color: #666;
}

ul.tabs li.active a {
    color: black;
}

dl.generic dd {
    margin-bottom: 1em;
}

.pari {
    color: olive;
}

.paro {
    color: maroon;
}

.comment {
    font-size: 80%;
    color: green;
    white-space: nowrap;
}

table.grid {
    border-collapse: collapse;
}

table.grid td {
    padding: 5px;
    border: 1px solid;
}

table.layout {
    border: 0px;
}

table.layout td {
    padding: 5px;
}

table.table {
    border-collapse: collapse;
}

table.table td {
    padding: 5px;
    border-left: 0px;
    border-right: 0px;
}

table.table tr:last-child {
    border-bottom: 1px solid;
}

table.table th {
    padding: 5px;
    border-top: 1px solid;
    border-bottom: 1px solid;
    border-left: 0px;
    border-right: 0px;
}

.details_summary {
    cursor: pointer;
}

table.toctable {
    width: 100%;
}

table.toctable col:first-child {
    width: 20%;
}

table.toctable col:nth-last-child(2) {
    width: 8%;
}

table.altcolored tr:nth-child(even) {
    background-color: #f3f3f3;
}

    </style>
<!--OP_REF_STYLE_END-->
<script>
    <!--
var active_lang='hdevelop';function switchVisibility(obj,active_lang,new_lang)
{var display_style='inline';
for(var i=0;i<obj.length;i++)
{if(obj.item(i).getAttribute('data-if')==new_lang)
{obj.item(i).style.display=display_style;}
if(obj.item(i).getAttribute('data-if')==active_lang)
{obj.item(i).style.display='none';}}
return;}
function toggleLanguage(new_lang,initial)
{if(active_lang!=new_lang)
{var lis=document.getElementsByTagName('li');for(var i=0;i<lis.length;i++)
{if(lis.item(i).id=='syn-'+new_lang)
{lis.item(i).className='active';}
else
{lis.item(i).className='inactive';}}
var divs=document.getElementsByTagName('div');var spans=document.getElementsByTagName('span');switchVisibility(divs,active_lang,new_lang);switchVisibility(spans,active_lang,new_lang);if(!initial)
{setCookie("halcon_reference_language",new_lang,null,null);}
active_lang=new_lang;}
return;}
function setCookie(name,value,domain,exp_offset,path,secure)
{localStorage.setItem(name,value);}
function getCookie(name)
{return localStorage.getItem(name);}
function initialize()
{var qs=location.href.split('?')[1];var qs_lang_raw=location.href.split('interface=')[1];var qs_lang;if(qs_lang_raw)
{qs_lang=qs_lang_raw.split('#')[0];}
var cookie_lang=getCookie("halcon_reference_language");var new_lang;if((qs_lang=="hdevelop")||(qs_lang=="dotnet")||(qs_lang=="python")||(qs_lang=="cpp")||(qs_lang=="c"))
{new_lang=qs_lang;setCookie("halcon_reference_language",new_lang,null,null);}
else if((cookie_lang=="hdevelop")||(cookie_lang=="dotnet")||(cookie_lang=="python")||(cookie_lang=="cpp")||(cookie_lang=="c"))
{new_lang=cookie_lang;}
else
{new_lang="hdevelop";}
toggleLanguage(new_lang,1);return;}
-->

  </script>
</head>
<body onload="initialize();">
<div class="breadcrumb">
<br class="inv"><a href="index.html">目录</a> / <a href="toc_transformations.html">变换</a> / <a href="toc_transformations_poses.html">Poses</a><br class="inv">
</div>
<div class="body_main">
<div class="tabbar"><ul class="tabs">
<li id="syn-hdevelop" class="active"><a href="javascript:void(0);" onclick="toggleLanguage('hdevelop')" onfocus="blur()">HDevelop</a></li>
<li id="syn-dotnet" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('dotnet')" onfocus="blur()">.NET</a></li>
<li id="syn-python" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('python')" onfocus="blur()">Python</a></li>
<li id="syn-cpp" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('cpp')" onfocus="blur()">C++</a></li>
<li id="syn-c" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('c')" onfocus="blur()">C</a></li>
</ul></div>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<!--OP_REF_HEADER_END-->
<h1 id="sec_name">
<span data-if="hdevelop" style="display:inline;">get_rectangle_pose</span><span data-if="c" style="display:none;">T_get_rectangle_pose</span><span data-if="cpp" style="display:none;">GetRectanglePose</span><span data-if="dotnet" style="display:none;">GetRectanglePose</span><span data-if="python" style="display:none;">get_rectangle_pose</span> (算子名称)</h1>
<h2>名称</h2>
<p><code><span data-if="hdevelop" style="display:inline;">get_rectangle_pose</span><span data-if="c" style="display:none;">T_get_rectangle_pose</span><span data-if="cpp" style="display:none;">GetRectanglePose</span><span data-if="dotnet" style="display:none;">GetRectanglePose</span><span data-if="python" style="display:none;">get_rectangle_pose</span></code> — Determine the 3D pose of a rectangle from its perspective 2D
projection</p>
<h2 id="sec_synopsis">参数签名</h2>
<div data-if="hdevelop" style="display:inline;">
<p>
<code><b>get_rectangle_pose</b>(<a href="#Contour"><i>Contour</i></a> :  : <a href="#CameraParam"><i>CameraParam</i></a>, <a href="#Width"><i>Width</i></a>, <a href="#Height"><i>Height</i></a>, <a href="#WeightingMode"><i>WeightingMode</i></a>, <a href="#ClippingFactor"><i>ClippingFactor</i></a> : <a href="#Pose"><i>Pose</i></a>, <a href="#CovPose"><i>CovPose</i></a>, <a href="#Error"><i>Error</i></a>)</code></p>
</div>
<div data-if="c" style="display:none;">
<p>
<code>Herror <b>T_get_rectangle_pose</b>(const Hobject <a href="#Contour"><i>Contour</i></a>, const Htuple <a href="#CameraParam"><i>CameraParam</i></a>, const Htuple <a href="#Width"><i>Width</i></a>, const Htuple <a href="#Height"><i>Height</i></a>, const Htuple <a href="#WeightingMode"><i>WeightingMode</i></a>, const Htuple <a href="#ClippingFactor"><i>ClippingFactor</i></a>, Htuple* <a href="#Pose"><i>Pose</i></a>, Htuple* <a href="#CovPose"><i>CovPose</i></a>, Htuple* <a href="#Error"><i>Error</i></a>)</code></p>
</div>
<div data-if="cpp" style="display:none;">
<p>
<code>void <b>GetRectanglePose</b>(const HObject&amp; <a href="#Contour"><i>Contour</i></a>, const HTuple&amp; <a href="#CameraParam"><i>CameraParam</i></a>, const HTuple&amp; <a href="#Width"><i>Width</i></a>, const HTuple&amp; <a href="#Height"><i>Height</i></a>, const HTuple&amp; <a href="#WeightingMode"><i>WeightingMode</i></a>, const HTuple&amp; <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#Pose"><i>Pose</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>)</code></p>
<p>
<code>HPoseArray <a href="HXLD.html">HXLD</a>::<b>GetRectanglePose</b>(const HCamPar&amp; <a href="#CameraParam"><i>CameraParam</i></a>, const HTuple&amp; <a href="#Width"><i>Width</i></a>, const HTuple&amp; <a href="#Height"><i>Height</i></a>, const HString&amp; <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HXLD.html">HXLD</a>::<b>GetRectanglePose</b>(const HCamPar&amp; <a href="#CameraParam"><i>CameraParam</i></a>, double <a href="#Width"><i>Width</i></a>, double <a href="#Height"><i>Height</i></a>, const HString&amp; <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HXLD.html">HXLD</a>::<b>GetRectanglePose</b>(const HCamPar&amp; <a href="#CameraParam"><i>CameraParam</i></a>, double <a href="#Width"><i>Width</i></a>, double <a href="#Height"><i>Height</i></a>, const char* <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HXLD.html">HXLD</a>::<b>GetRectanglePose</b>(const HCamPar&amp; <a href="#CameraParam"><i>CameraParam</i></a>, double <a href="#Width"><i>Width</i></a>, double <a href="#Height"><i>Height</i></a>, const wchar_t* <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const  <span class="signnote">
            (
            Windows only)
          </span></code></p>
<p>
<code>HPoseArray <a href="HCamPar.html">HCamPar</a>::<b>GetRectanglePose</b>(const HXLD&amp; <a href="#Contour"><i>Contour</i></a>, const HTuple&amp; <a href="#Width"><i>Width</i></a>, const HTuple&amp; <a href="#Height"><i>Height</i></a>, const HString&amp; <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HCamPar.html">HCamPar</a>::<b>GetRectanglePose</b>(const HXLD&amp; <a href="#Contour"><i>Contour</i></a>, double <a href="#Width"><i>Width</i></a>, double <a href="#Height"><i>Height</i></a>, const HString&amp; <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HCamPar.html">HCamPar</a>::<b>GetRectanglePose</b>(const HXLD&amp; <a href="#Contour"><i>Contour</i></a>, double <a href="#Width"><i>Width</i></a>, double <a href="#Height"><i>Height</i></a>, const char* <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HCamPar.html">HCamPar</a>::<b>GetRectanglePose</b>(const HXLD&amp; <a href="#Contour"><i>Contour</i></a>, double <a href="#Width"><i>Width</i></a>, double <a href="#Height"><i>Height</i></a>, const wchar_t* <a href="#WeightingMode"><i>WeightingMode</i></a>, double <a href="#ClippingFactor"><i>ClippingFactor</i></a>, HTuple* <a href="#CovPose"><i>CovPose</i></a>, HTuple* <a href="#Error"><i>Error</i></a>) const  <span class="signnote">
            (
            Windows only)
          </span></code></p>
</div>
<div data-if="com" style="display:none;"></div>
<div data-if="dotnet" style="display:none;">
<p>
<code>static void <a href="HOperatorSet.html">HOperatorSet</a>.<b>GetRectanglePose</b>(<a href="HObject.html">HObject</a> <a href="#Contour"><i>contour</i></a>, <a href="HTuple.html">HTuple</a> <a href="#CameraParam"><i>cameraParam</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Width"><i>width</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Height"><i>height</i></a>, <a href="HTuple.html">HTuple</a> <a href="#WeightingMode"><i>weightingMode</i></a>, <a href="HTuple.html">HTuple</a> <a href="#ClippingFactor"><i>clippingFactor</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Pose"><i>pose</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#CovPose"><i>covPose</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Error"><i>error</i></a>)</code></p>
<p>
<code><a href="HPose.html">HPose[]</a> <a href="HXLD.html">HXLD</a>.<b>GetRectanglePose</b>(<a href="HCamPar.html">HCamPar</a> <a href="#CameraParam"><i>cameraParam</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Width"><i>width</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Height"><i>height</i></a>, string <a href="#WeightingMode"><i>weightingMode</i></a>, double <a href="#ClippingFactor"><i>clippingFactor</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#CovPose"><i>covPose</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Error"><i>error</i></a>)</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HXLD.html">HXLD</a>.<b>GetRectanglePose</b>(<a href="HCamPar.html">HCamPar</a> <a href="#CameraParam"><i>cameraParam</i></a>, double <a href="#Width"><i>width</i></a>, double <a href="#Height"><i>height</i></a>, string <a href="#WeightingMode"><i>weightingMode</i></a>, double <a href="#ClippingFactor"><i>clippingFactor</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#CovPose"><i>covPose</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Error"><i>error</i></a>)</code></p>
<p>
<code><a href="HPose.html">HPose[]</a> <a href="HCamPar.html">HCamPar</a>.<b>GetRectanglePose</b>(<a href="HXLD.html">HXLD</a> <a href="#Contour"><i>contour</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Width"><i>width</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Height"><i>height</i></a>, string <a href="#WeightingMode"><i>weightingMode</i></a>, double <a href="#ClippingFactor"><i>clippingFactor</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#CovPose"><i>covPose</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Error"><i>error</i></a>)</code></p>
<p>
<code><a href="HPose.html">HPose</a> <a href="HCamPar.html">HCamPar</a>.<b>GetRectanglePose</b>(<a href="HXLD.html">HXLD</a> <a href="#Contour"><i>contour</i></a>, double <a href="#Width"><i>width</i></a>, double <a href="#Height"><i>height</i></a>, string <a href="#WeightingMode"><i>weightingMode</i></a>, double <a href="#ClippingFactor"><i>clippingFactor</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#CovPose"><i>covPose</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Error"><i>error</i></a>)</code></p>
</div>
<div data-if="python" style="display:none;">
<p>
<code>def <b>get_rectangle_pose</b>(<a href="#Contour"><i>contour</i></a>: HObject, <a href="#CameraParam"><i>camera_param</i></a>: Sequence[Union[int, float, str]], <a href="#Width"><i>width</i></a>: MaybeSequence[float], <a href="#Height"><i>height</i></a>: MaybeSequence[float], <a href="#WeightingMode"><i>weighting_mode</i></a>: str, <a href="#ClippingFactor"><i>clipping_factor</i></a>: float) -&gt; Tuple[Sequence[Union[int, float]], Sequence[float], Sequence[float]]</code></p>
</div>
<h2 id="sec_description">描述</h2>
<p>A rectangle in space is projected as a general quadrangle into the
image.  <code><span data-if="hdevelop" style="display:inline">get_rectangle_pose</span><span data-if="c" style="display:none">get_rectangle_pose</span><span data-if="cpp" style="display:none">GetRectanglePose</span><span data-if="com" style="display:none">GetRectanglePose</span><span data-if="dotnet" style="display:none">GetRectanglePose</span><span data-if="python" style="display:none">get_rectangle_pose</span></code> determines the <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a> of
the rectangle from this projection (<a href="#Contour"><i><code><span data-if="hdevelop" style="display:inline">Contour</span><span data-if="c" style="display:none">Contour</span><span data-if="cpp" style="display:none">Contour</span><span data-if="com" style="display:none">Contour</span><span data-if="dotnet" style="display:none">contour</span><span data-if="python" style="display:none">contour</span></code></i></a>).
</p>
<p>The algorithm works as follows: First, <a href="#Contour"><i><code><span data-if="hdevelop" style="display:inline">Contour</span><span data-if="c" style="display:none">Contour</span><span data-if="cpp" style="display:none">Contour</span><span data-if="com" style="display:none">Contour</span><span data-if="dotnet" style="display:none">contour</span><span data-if="python" style="display:none">contour</span></code></i></a> is segmented
into four line segments and their intersections are considered as
corners of the contour. The corners together with the internal
camera parameters (<a href="#CameraParam"><i><code><span data-if="hdevelop" style="display:inline">CameraParam</span><span data-if="c" style="display:none">CameraParam</span><span data-if="cpp" style="display:none">CameraParam</span><span data-if="com" style="display:none">CameraParam</span><span data-if="dotnet" style="display:none">cameraParam</span><span data-if="python" style="display:none">camera_param</span></code></i></a>) and the rectangle size in
meters (<a href="#Width"><i><code><span data-if="hdevelop" style="display:inline">Width</span><span data-if="c" style="display:none">Width</span><span data-if="cpp" style="display:none">Width</span><span data-if="com" style="display:none">Width</span><span data-if="dotnet" style="display:none">width</span><span data-if="python" style="display:none">width</span></code></i></a>, <a href="#Height"><i><code><span data-if="hdevelop" style="display:inline">Height</span><span data-if="c" style="display:none">Height</span><span data-if="cpp" style="display:none">Height</span><span data-if="com" style="display:none">Height</span><span data-if="dotnet" style="display:none">height</span><span data-if="python" style="display:none">height</span></code></i></a>) are used for an initial
estimation of the rectangle pose. Then, the final <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a> is
refined with a non-linear optimization by minimizing the geometrical
distance of the contour points from the back projection of the
rectangle in the image.
</p>
<p>该算子 supports only area scan pinhole (projective)
cameras. An error is returned if <a href="#CameraParam"><i><code><span data-if="hdevelop" style="display:inline">CameraParam</span><span data-if="c" style="display:none">CameraParam</span><span data-if="cpp" style="display:none">CameraParam</span><span data-if="com" style="display:none">CameraParam</span><span data-if="dotnet" style="display:none">cameraParam</span><span data-if="python" style="display:none">camera_param</span></code></i></a> specifies a
line scan or a telecentric camera (see also
<a href="toc_calibration.html">Calibration</a>).
</p>
<p><a href="#Width"><i><code><span data-if="hdevelop" style="display:inline">Width</span><span data-if="c" style="display:none">Width</span><span data-if="cpp" style="display:none">Width</span><span data-if="com" style="display:none">Width</span><span data-if="dotnet" style="display:none">width</span><span data-if="python" style="display:none">width</span></code></i></a> and <a href="#Height"><i><code><span data-if="hdevelop" style="display:inline">Height</span><span data-if="c" style="display:none">Height</span><span data-if="cpp" style="display:none">Height</span><span data-if="com" style="display:none">Height</span><span data-if="dotnet" style="display:none">height</span><span data-if="python" style="display:none">height</span></code></i></a> specify the size of the rectangle
in x and y dimensions, respectively, in its coordinate
system. The origin of this coordinate system is in the center of the
rectangle. The z axis points away from the camera.
</p>
<p>The arguments <a href="#WeightingMode"><i><code><span data-if="hdevelop" style="display:inline">WeightingMode</span><span data-if="c" style="display:none">WeightingMode</span><span data-if="cpp" style="display:none">WeightingMode</span><span data-if="com" style="display:none">WeightingMode</span><span data-if="dotnet" style="display:none">weightingMode</span><span data-if="python" style="display:none">weighting_mode</span></code></i></a> and <a href="#ClippingFactor"><i><code><span data-if="hdevelop" style="display:inline">ClippingFactor</span><span data-if="c" style="display:none">ClippingFactor</span><span data-if="cpp" style="display:none">ClippingFactor</span><span data-if="com" style="display:none">ClippingFactor</span><span data-if="dotnet" style="display:none">clippingFactor</span><span data-if="python" style="display:none">clipping_factor</span></code></i></a> can
be used to damp the impact of outliers on the algorithm. If
<a href="#WeightingMode"><i><code><span data-if="hdevelop" style="display:inline">WeightingMode</span><span data-if="c" style="display:none">WeightingMode</span><span data-if="cpp" style="display:none">WeightingMode</span><span data-if="com" style="display:none">WeightingMode</span><span data-if="dotnet" style="display:none">weightingMode</span><span data-if="python" style="display:none">weighting_mode</span></code></i></a> is set to <i><span data-if="hdevelop" style="display:inline">'tukey'</span><span data-if="c" style="display:none">"tukey"</span><span data-if="cpp" style="display:none">"tukey"</span><span data-if="com" style="display:none">"tukey"</span><span data-if="dotnet" style="display:none">"tukey"</span><span data-if="python" style="display:none">"tukey"</span></i> or <i><span data-if="hdevelop" style="display:inline">'huber'</span><span data-if="c" style="display:none">"huber"</span><span data-if="cpp" style="display:none">"huber"</span><span data-if="com" style="display:none">"huber"</span><span data-if="dotnet" style="display:none">"huber"</span><span data-if="python" style="display:none">"huber"</span></i>,
the contour points are weighted based on the approach of Tukey or Huber
respectively. In such a case a robust error statistics is used to
estimate the standard deviation of the distances of the contour
points from the backprojected rectangle excluding outliers. The
parameter <a href="#ClippingFactor"><i><code><span data-if="hdevelop" style="display:inline">ClippingFactor</span><span data-if="c" style="display:none">ClippingFactor</span><span data-if="cpp" style="display:none">ClippingFactor</span><span data-if="com" style="display:none">ClippingFactor</span><span data-if="dotnet" style="display:none">clippingFactor</span><span data-if="python" style="display:none">clipping_factor</span></code></i></a> (a scaling factor for the standard
deviation) controls the amount of damping outliers: The smaller the
value chosen for <a href="#ClippingFactor"><i><code><span data-if="hdevelop" style="display:inline">ClippingFactor</span><span data-if="c" style="display:none">ClippingFactor</span><span data-if="cpp" style="display:none">ClippingFactor</span><span data-if="com" style="display:none">ClippingFactor</span><span data-if="dotnet" style="display:none">clippingFactor</span><span data-if="python" style="display:none">clipping_factor</span></code></i></a> the more outliers are
detected. See a discussion about the properties of the different
weighting modes in <a href="fit_line_contour_xld.html"><code><span data-if="hdevelop" style="display:inline">fit_line_contour_xld</span><span data-if="c" style="display:none">fit_line_contour_xld</span><span data-if="cpp" style="display:none">FitLineContourXld</span><span data-if="com" style="display:none">FitLineContourXld</span><span data-if="dotnet" style="display:none">FitLineContourXld</span><span data-if="python" style="display:none">fit_line_contour_xld</span></code></a>. Note that, unlike
by <a href="fit_line_contour_xld.html"><code><span data-if="hdevelop" style="display:inline">fit_line_contour_xld</span><span data-if="c" style="display:none">fit_line_contour_xld</span><span data-if="cpp" style="display:none">FitLineContourXld</span><span data-if="com" style="display:none">FitLineContourXld</span><span data-if="dotnet" style="display:none">FitLineContourXld</span><span data-if="python" style="display:none">fit_line_contour_xld</span></code></a>, for the rectangle pose estimation
the approach of Huber is recommended.
</p>
<h3>Output</h3>
The resulting <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a> is of code-0 (see <a href="create_pose.html"><code><span data-if="hdevelop" style="display:inline">create_pose</span><span data-if="c" style="display:none">create_pose</span><span data-if="cpp" style="display:none">CreatePose</span><span data-if="com" style="display:none">CreatePose</span><span data-if="dotnet" style="display:none">CreatePose</span><span data-if="python" style="display:none">create_pose</span></code></a>)
and represents the pose of the center of the rectangle. You can
compute the pose of the corners of the rectangle as follows:
<div style="text-align:center"><table style="width:90%;margin-left:auto;margin-right:auto" class="layout">
<col span="1" style="width:90%;">
<tr><td style="text-align:left">
<a href="set_origin_pose.html"><code><span data-if="hdevelop" style="display:inline">set_origin_pose(\ParRef{Pose},  \ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner1)</span><span data-if="c" style="display:none">set_origin_pose(\ParRef{Pose},  \ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner1)</span><span data-if="cpp" style="display:none">SetOriginPose(\ParRef{Pose},  \ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner1)</span><span data-if="com" style="display:none">SetOriginPose(\ParRef{Pose},  \ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner1)</span><span data-if="dotnet" style="display:none">SetOriginPose(\ParRef{Pose},  \ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner1)</span><span data-if="python" style="display:none">set_origin_pose(\ParRef{Pose},  \ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner1)</span></code></a>
</td></tr>
<tr><td style="text-align:left">
<a href="set_origin_pose.html"><code><span data-if="hdevelop" style="display:inline">set_origin_pose(\ParRef{Pose},  \ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner2)</span><span data-if="c" style="display:none">set_origin_pose(\ParRef{Pose},  \ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner2)</span><span data-if="cpp" style="display:none">SetOriginPose(\ParRef{Pose},  \ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner2)</span><span data-if="com" style="display:none">SetOriginPose(\ParRef{Pose},  \ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner2)</span><span data-if="dotnet" style="display:none">SetOriginPose(\ParRef{Pose},  \ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner2)</span><span data-if="python" style="display:none">set_origin_pose(\ParRef{Pose},  \ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner2)</span></code></a>
</td></tr>
<tr><td style="text-align:left">
<a href="set_origin_pose.html"><code><span data-if="hdevelop" style="display:inline">set_origin_pose(\ParRef{Pose}, -\ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner3)</span><span data-if="c" style="display:none">set_origin_pose(\ParRef{Pose}, -\ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner3)</span><span data-if="cpp" style="display:none">SetOriginPose(\ParRef{Pose}, -\ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner3)</span><span data-if="com" style="display:none">SetOriginPose(\ParRef{Pose}, -\ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner3)</span><span data-if="dotnet" style="display:none">SetOriginPose(\ParRef{Pose}, -\ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner3)</span><span data-if="python" style="display:none">set_origin_pose(\ParRef{Pose}, -\ParRef{Width}/2,  \ParRef{Height}/2, 0, PoseCorner3)</span></code></a>
</td></tr>
<tr><td style="text-align:left">
<a href="set_origin_pose.html"><code><span data-if="hdevelop" style="display:inline">set_origin_pose(\ParRef{Pose}, -\ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner4)</span><span data-if="c" style="display:none">set_origin_pose(\ParRef{Pose}, -\ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner4)</span><span data-if="cpp" style="display:none">SetOriginPose(\ParRef{Pose}, -\ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner4)</span><span data-if="com" style="display:none">SetOriginPose(\ParRef{Pose}, -\ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner4)</span><span data-if="dotnet" style="display:none">SetOriginPose(\ParRef{Pose}, -\ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner4)</span><span data-if="python" style="display:none">set_origin_pose(\ParRef{Pose}, -\ParRef{Width}/2, -\ParRef{Height}/2, 0, PoseCorner4)</span></code></a>
</td></tr>
<tr><td style="text-align:left">
</td></tr>
</table></div>
A rectangle is symmetric with respect to its x, y, and z axis
and one and the same contour can represent a rectangle in 4
different poses. The angles in <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a> are normalized to be in
the range [-90; 90] degrees and the rest of the 4 possible poses
can be computed by combining flips around the corresponding axis:
<div style="text-align:center"><table style="width:90%;margin-left:auto;margin-right:auto" class="layout">
<col span="1" style="width:90%;">
<tr><td style="text-align:left">
<code>* NOTE: the following code works ONLY for pose of code-0</code>
</td></tr>
<tr><td style="text-align:left">
<code>*       as it is returned by \OpRef{get_rectangle_pose</code>}</td></tr>
<tr><td style="text-align:left">
<code>*</code>
</td></tr>
<tr><td style="text-align:left">
<code>* flip around z-axis</code>
</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedZ := \ParRef{Pose</code>}</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedZ[5] :=  PoseFlippedZ[5]+180</code>
</td></tr>
<tr><td style="text-align:left">
<code>* flip around y-axis</code>
</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedY := \ParRef{Pose</code>}</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedY[4] :=  PoseFlippedY[4]+180</code>
</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedY[5] := -PoseFlippedY[5]</code>
</td></tr>
<tr><td style="text-align:left">
<code>* flip around x-axis</code>
</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedX := \ParRef{Pose</code>}</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedX[3] :=  PoseFlippedX[3]+180</code>
</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedX[4] := -PoseFlippedX[4]</code>
</td></tr>
<tr><td style="text-align:left">
<code>PoseFlippedX[5] := -PoseFlippedX[5]</code>
</td></tr>
<tr><td style="text-align:left">
</td></tr>
</table></div>
<p>Note that if the rectangle is a square (<a href="#Width"><i><code><span data-if="hdevelop" style="display:inline">Width</span><span data-if="c" style="display:none">Width</span><span data-if="cpp" style="display:none">Width</span><span data-if="com" style="display:none">Width</span><span data-if="dotnet" style="display:none">width</span><span data-if="python" style="display:none">width</span></code></i></a> ==
<a href="#Height"><i><code><span data-if="hdevelop" style="display:inline">Height</span><span data-if="c" style="display:none">Height</span><span data-if="cpp" style="display:none">Height</span><span data-if="com" style="display:none">Height</span><span data-if="dotnet" style="display:none">height</span><span data-if="python" style="display:none">height</span></code></i></a>) the number of alternative poses is 8.
</p>
<p>If more than one contour are given in <a href="#Contour"><i><code><span data-if="hdevelop" style="display:inline">Contour</span><span data-if="c" style="display:none">Contour</span><span data-if="cpp" style="display:none">Contour</span><span data-if="com" style="display:none">Contour</span><span data-if="dotnet" style="display:none">contour</span><span data-if="python" style="display:none">contour</span></code></i></a>, a
corresponding tuple of values for both <a href="#Width"><i><code><span data-if="hdevelop" style="display:inline">Width</span><span data-if="c" style="display:none">Width</span><span data-if="cpp" style="display:none">Width</span><span data-if="com" style="display:none">Width</span><span data-if="dotnet" style="display:none">width</span><span data-if="python" style="display:none">width</span></code></i></a> and
<a href="#Height"><i><code><span data-if="hdevelop" style="display:inline">Height</span><span data-if="c" style="display:none">Height</span><span data-if="cpp" style="display:none">Height</span><span data-if="com" style="display:none">Height</span><span data-if="dotnet" style="display:none">height</span><span data-if="python" style="display:none">height</span></code></i></a> has to be provided as well. Yet, if only one value
is provided for each of these arguments, then this value is applied
for each processed contour. A pose is estimated for each processed
contour and all poses are concatenated in <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a> (see the
example below).
</p>
<h3>Accuracy of the pose</h3>
<p>The accuracy of the estimated pose depends on the following three
factors:
</p>
<ul>
<li>
<p> ratio <a href="#Width"><i><code><span data-if="hdevelop" style="display:inline">Width</span><span data-if="c" style="display:none">Width</span><span data-if="cpp" style="display:none">Width</span><span data-if="com" style="display:none">Width</span><span data-if="dotnet" style="display:none">width</span><span data-if="python" style="display:none">width</span></code></i></a>/<a href="#Height"><i><code><span data-if="hdevelop" style="display:inline">Height</span><span data-if="c" style="display:none">Height</span><span data-if="cpp" style="display:none">Height</span><span data-if="com" style="display:none">Height</span><span data-if="dotnet" style="display:none">height</span><span data-if="python" style="display:none">height</span></code></i></a>
</p>
</li>
<li>
<p> length of the projected contour
</p>
</li>
<li>
<p> degree of perspective distortion of the contour
</p>
</li>
</ul>
<p>In order to achieve an accurate pose estimation, there are three
corresponding criteria that should be considered:
</p>
<p>The <b>ratio</b> <a href="#Width"><i><code><span data-if="hdevelop" style="display:inline">Width</span><span data-if="c" style="display:none">Width</span><span data-if="cpp" style="display:none">Width</span><span data-if="com" style="display:none">Width</span><span data-if="dotnet" style="display:none">width</span><span data-if="python" style="display:none">width</span></code></i></a>/<a href="#Height"><i><code><span data-if="hdevelop" style="display:inline">Height</span><span data-if="c" style="display:none">Height</span><span data-if="cpp" style="display:none">Height</span><span data-if="com" style="display:none">Height</span><span data-if="dotnet" style="display:none">height</span><span data-if="python" style="display:none">height</span></code></i></a>
should fulfill
<span title="1" class="displaymath"><!-- Created by MetaPost 1.902 on 2023.05.15:2033 --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="11.0906em" height="2.12442em" viewBox="0 0 177.449158 33.990662">
<!-- Original BoundingBox: -88.724579 -16.995331 88.724579 16.995331 -->
  <defs>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_72">
      <path style="fill-rule: evenodd;" d="M437.000000 -272.000000L437.000000 -41.000000L383.000000 -41.000000C365.000000 -41.000000,356.000000 -34.000000,356.000000 -21.000000C356.000000 -7.000000,365.000000 -0.000000,383.000000 -0.000000L524.000000 -0.000000C541.000000 -0.000000,551.000000 -7.000000,551.000000 -21.000000C551.000000 -34.000000,542.000000 -41.000000,524.000000 -41.000000L478.000000 -41.000000L478.000000 -522.000000L503.000000 -522.000000C521.000000 -522.000000,530.000000 -529.000000,530.000000 -543.000000C530.000000 -556.000000,521.000000 -563.000000,503.000000 -563.000000L383.000000 -563.000000C365.000000 -563.000000,356.000000 -556.000000,356.000000 -543.000000C356.000000 -529.000000,365.000000 -522.000000,383.000000 -522.000000L437.000000 -522.000000L437.000000 -313.000000L167.000000 -313.000000L167.000000 -522.000000L221.000000 -522.000000C239.000000 -522.000000,248.000000 -529.000000,248.000000 -543.000000C248.000000 -556.000000,239.000000 -563.000000,221.000000 -563.000000L101.000000 -563.000000C83.000000 -563.000000,74.000000 -556.000000,74.000000 -543.000000C74.000000 -529.000000,83.000000 -522.000000,101.000000 -522.000000L126.000000 -522.000000L126.000000 -41.000000L81.000000 -41.000000C62.000000 -41.000000,53.000000 -34.000000,53.000000 -21.000000C53.000000 -7.000000,63.000000 -0.000000,81.000000 -0.000000L221.000000 -0.000000C239.000000 -0.000000,248.000000 -7.000000,248.000000 -21.000000C248.000000 -34.000000,239.000000 -41.000000,221.000000 -41.000000L167.000000 -41.000000L167.000000 -272.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_87">
      <path style="fill-rule: evenodd;" d="M122.000000 -0.000000L185.000000 -0.000000L300.000000 -400.000000L412.000000 -0.000000L476.000000 -0.000000L538.000000 -522.000000L553.000000 -522.000000C571.000000 -522.000000,580.000000 -529.000000,580.000000 -543.000000C580.000000 -556.000000,571.000000 -563.000000,553.000000 -563.000000L403.000000 -563.000000C385.000000 -563.000000,376.000000 -556.000000,376.000000 -543.000000C376.000000 -529.000000,385.000000 -522.000000,403.000000 -522.000000L499.000000 -522.000000L442.000000 -46.000000L333.000000 -438.000000L271.000000 -438.000000L159.000000 -46.000000L103.000000 -522.000000L196.000000 -522.000000C215.000000 -522.000000,224.000000 -529.000000,224.000000 -543.000000C224.000000 -556.000000,215.000000 -563.000000,196.000000 -563.000000L47.000000 -563.000000C29.000000 -563.000000,20.000000 -556.000000,20.000000 -543.000000C20.000000 -529.000000,29.000000 -522.000000,47.000000 -522.000000L62.000000 -522.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_100">
      <path style="fill-rule: evenodd;" d="M502.000000 -604.000000L407.000000 -604.000000C389.000000 -604.000000,380.000000 -597.000000,380.000000 -584.000000C380.000000 -570.000000,389.000000 -563.000000,407.000000 -563.000000L461.000000 -563.000000L461.000000 -327.000000C412.000000 -398.000000,354.000000 -431.000000,279.000000 -431.000000C160.000000 -431.000000,63.000000 -331.000000,63.000000 -208.000000C63.000000 -85.000000,160.000000 16.000000,279.000000 16.000000C354.000000 16.000000,414.000000 -19.000000,461.000000 -89.000000L461.000000 -0.000000L556.000000 -0.000000C574.000000 -0.000000,583.000000 -7.000000,583.000000 -21.000000C583.000000 -34.000000,574.000000 -41.000000,556.000000 -41.000000L502.000000 -41.000000M282.000000 -390.000000C383.000000 -390.000000,461.000000 -310.000000,461.000000 -206.000000C461.000000 -106.000000,381.000000 -25.000000,283.000000 -25.000000C183.000000 -25.000000,104.000000 -106.000000,104.000000 -208.000000C104.000000 -309.000000,183.000000 -390.000000,282.000000 -390.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_101">
      <path style="fill-rule: evenodd;" d="M520.000000 -199.000000C520.000000 -245.000000,517.000000 -264.000000,503.000000 -297.000000C467.000000 -380.000000,387.000000 -431.000000,291.000000 -431.000000C163.000000 -431.000000,63.000000 -338.000000,63.000000 -217.000000C63.000000 -87.000000,170.000000 16.000000,305.000000 16.000000C396.000000 16.000000,516.000000 -31.000000,516.000000 -66.000000C516.000000 -77.000000,507.000000 -86.000000,497.000000 -86.000000C492.000000 -86.000000,488.000000 -84.000000,481.000000 -79.000000C441.000000 -47.000000,368.000000 -25.000000,306.000000 -25.000000C198.000000 -25.000000,118.000000 -94.000000,104.000000 -199.000000M104.000000 -240.000000C122.000000 -332.000000,194.000000 -390.000000,291.000000 -390.000000C388.000000 -390.000000,462.000000 -331.000000,478.000000 -240.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_103">
      <path style="fill-rule: evenodd;" d="M440.000000 -334.000000C395.000000 -401.000000,342.000000 -431.000000,269.000000 -431.000000C156.000000 -431.000000,63.000000 -337.000000,63.000000 -221.000000C63.000000 -105.000000,156.000000 -10.000000,269.000000 -10.000000C341.000000 -10.000000,395.000000 -41.000000,440.000000 -107.000000L440.000000 22.000000C440.000000 90.000000,386.000000 145.000000,318.000000 145.000000L202.000000 145.000000C184.000000 145.000000,175.000000 152.000000,175.000000 165.000000C175.000000 179.000000,184.000000 186.000000,202.000000 186.000000L316.000000 186.000000C366.000000 186.000000,403.000000 169.000000,438.000000 132.000000C468.000000 100.000000,481.000000 69.000000,481.000000 28.000000L481.000000 -376.000000L535.000000 -376.000000C553.000000 -376.000000,562.000000 -383.000000,562.000000 -397.000000C562.000000 -410.000000,553.000000 -417.000000,535.000000 -417.000000L440.000000 -417.000000M272.000000 -390.000000C367.000000 -390.000000,440.000000 -316.000000,440.000000 -219.000000C440.000000 -126.000000,365.000000 -51.000000,272.000000 -51.000000C179.000000 -51.000000,104.000000 -126.000000,104.000000 -221.000000C104.000000 -315.000000,178.000000 -390.000000,272.000000 -390.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_104">
      <path style="fill-rule: evenodd;" d="M165.000000 -604.000000L70.000000 -604.000000C52.000000 -604.000000,43.000000 -597.000000,43.000000 -584.000000C43.000000 -570.000000,52.000000 -563.000000,70.000000 -563.000000L124.000000 -563.000000L124.000000 -41.000000L78.000000 -41.000000C60.000000 -41.000000,51.000000 -34.000000,51.000000 -21.000000C51.000000 -7.000000,61.000000 -0.000000,78.000000 -0.000000L210.000000 -0.000000C228.000000 -0.000000,238.000000 -7.000000,238.000000 -21.000000C238.000000 -34.000000,229.000000 -41.000000,210.000000 -41.000000L165.000000 -41.000000L165.000000 -296.000000L176.000000 -309.000000C230.000000 -373.000000,258.000000 -390.000000,314.000000 -390.000000C354.000000 -390.000000,376.000000 -383.000000,399.000000 -364.000000C424.000000 -344.000000,437.000000 -318.000000,437.000000 -288.000000L437.000000 -41.000000L392.000000 -41.000000C374.000000 -41.000000,365.000000 -34.000000,365.000000 -21.000000C365.000000 -7.000000,374.000000 -0.000000,392.000000 -0.000000L523.000000 -0.000000C542.000000 -0.000000,551.000000 -7.000000,551.000000 -21.000000C551.000000 -34.000000,542.000000 -41.000000,523.000000 -41.000000L478.000000 -41.000000L478.000000 -291.000000C478.000000 -372.000000,412.000000 -431.000000,319.000000 -431.000000C258.000000 -431.000000,216.000000 -408.000000,165.000000 -347.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_105">
      <path style="fill-rule: evenodd;" d="M320.000000 -417.000000L161.000000 -417.000000C143.000000 -417.000000,134.000000 -410.000000,134.000000 -397.000000C134.000000 -383.000000,143.000000 -376.000000,161.000000 -376.000000L279.000000 -376.000000L279.000000 -41.000000L119.000000 -41.000000C101.000000 -41.000000,92.000000 -34.000000,92.000000 -21.000000C92.000000 -7.000000,101.000000 -0.000000,119.000000 -0.000000L480.000000 -0.000000C498.000000 -0.000000,508.000000 -7.000000,508.000000 -21.000000C508.000000 -34.000000,499.000000 -41.000000,480.000000 -41.000000L320.000000 -41.000000M318.000000 -624.000000L259.000000 -624.000000L259.000000 -520.000000L318.000000 -520.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHpcrr8r_116">
      <path style="fill-rule: evenodd;" d="M186.000000 -417.000000L186.000000 -536.000000C186.000000 -555.000000,180.000000 -563.000000,166.000000 -563.000000C152.000000 -563.000000,145.000000 -554.000000,145.000000 -536.000000L145.000000 -417.000000L71.000000 -417.000000C52.000000 -417.000000,43.000000 -410.000000,43.000000 -397.000000C43.000000 -383.000000,52.000000 -376.000000,71.000000 -376.000000L145.000000 -376.000000L145.000000 -107.000000C145.000000 -32.000000,206.000000 16.000000,300.000000 16.000000C385.000000 16.000000,499.000000 -22.000000,499.000000 -51.000000C499.000000 -61.000000,490.000000 -71.000000,480.000000 -71.000000C475.000000 -71.000000,472.000000 -70.000000,464.000000 -65.000000C425.000000 -42.000000,354.000000 -25.000000,298.000000 -25.000000C229.000000 -25.000000,186.000000 -58.000000,186.000000 -109.000000L186.000000 -376.000000L406.000000 -376.000000C424.000000 -376.000000,433.000000 -383.000000,433.000000 -397.000000C433.000000 -410.000000,424.000000 -417.000000,406.000000 -417.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmr10_49">
      <path style="fill-rule: evenodd;" d="M294.000000 -640.000000C294.000000 -664.000000,294.000000 -666.000000,271.000000 -666.000000C209.000000 -602.000000,121.000000 -602.000000,89.000000 -602.000000L89.000000 -571.000000C109.000000 -571.000000,168.000000 -571.000000,220.000000 -597.000000L220.000000 -79.000000C220.000000 -43.000000,217.000000 -31.000000,127.000000 -31.000000L95.000000 -31.000000L95.000000 -0.000000L257.000000 -0.000000L130.000000 -3.000000L217.000000 -3.000000L257.000000 -3.000000L297.000000 -3.000000L384.000000 -3.000000L419.000000 -0.000000L419.000000 -31.000000L387.000000 -31.000000C297.000000 -31.000000,294.000000 -42.000000,294.000000 -79.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmr10_51">
      <path style="fill-rule: evenodd;" d="M290.000000 -352.000000C372.000000 -379.000000,430.000000 -449.000000,430.000000 -528.000000C430.000000 -610.000000,342.000000 -666.000000,246.000000 -666.000000C145.000000 -666.000000,69.000000 -606.000000,69.000000 -530.000000C69.000000 -497.000000,91.000000 -478.000000,120.000000 -478.000000C151.000000 -478.000000,171.000000 -500.000000,171.000000 -529.000000C171.000000 -579.000000,124.000000 -579.000000,109.000000 -579.000000C140.000000 -628.000000,206.000000 -641.000000,242.000000 -641.000000C283.000000 -641.000000,338.000000 -619.000000,338.000000 -529.000000C338.000000 -517.000000,336.000000 -459.000000,310.000000 -415.000000C280.000000 -367.000000,246.000000 -364.000000,221.000000 -363.000000C213.000000 -362.000000,189.000000 -360.000000,182.000000 -360.000000C174.000000 -359.000000,167.000000 -358.000000,167.000000 -348.000000C167.000000 -337.000000,174.000000 -337.000000,191.000000 -337.000000L235.000000 -337.000000C317.000000 -337.000000,354.000000 -269.000000,354.000000 -171.000000C354.000000 -35.000000,285.000000 -6.000000,241.000000 -6.000000C198.000000 -6.000000,123.000000 -23.000000,88.000000 -82.000000C123.000000 -77.000000,154.000000 -99.000000,154.000000 -137.000000C154.000000 -173.000000,127.000000 -193.000000,98.000000 -193.000000C74.000000 -193.000000,42.000000 -179.000000,42.000000 -135.000000C42.000000 -44.000000,135.000000 22.000000,244.000000 22.000000C366.000000 22.000000,457.000000 -69.000000,457.000000 -171.000000C457.000000 -253.000000,394.000000 -331.000000,290.000000 -352.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmmi10_60">
      <path style="fill-rule: evenodd;" d="M675.000000 -498.000000C687.000000 -504.000000,694.000000 -509.000000,694.000000 -520.000000C694.000000 -531.000000,685.000000 -540.000000,674.000000 -540.000000C671.000000 -540.000000,669.000000 -540.000000,656.000000 -533.000000L102.000000 -272.000000C91.000000 -267.000000,83.000000 -262.000000,83.000000 -250.000000C83.000000 -238.000000,91.000000 -233.000000,102.000000 -228.000000L656.000000 33.000000C669.000000 40.000000,671.000000 40.000000,674.000000 40.000000C685.000000 40.000000,694.000000 31.000000,694.000000 20.000000C694.000000 9.000000,687.000000 4.000000,675.000000 -2.000000L150.000000 -250.000000"></path>
    </g>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmmi10_61">
      <path style="fill-rule: evenodd;" d="M439.000000 -712.000000C444.000000 -725.000000,444.000000 -729.000000,444.000000 -730.000000C444.000000 -741.000000,435.000000 -750.000000,424.000000 -750.000000C417.000000 -750.000000,410.000000 -747.000000,407.000000 -741.000000L60.000000 212.000000C55.000000 225.000000,55.000000 229.000000,55.000000 230.000000C55.000000 241.000000,64.000000 250.000000,75.000000 250.000000C88.000000 250.000000,91.000000 243.000000,97.000000 226.000000"></path>
    </g>
  </defs>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,2.188217 10.277328)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmr10_49"></use>
  </g>
  <path d="M2.188217 17.075912L10.158340 17.075912" style="stroke:rgb(0.000000%,0.000000%,0.000000%); stroke-width: 0.637604;stroke-linejoin: round;stroke-miterlimit: 10.000000;fill: none;"></path>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,2.188217 31.995331)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmr10_51"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,16.498993 21.061066)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmmi10_60"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,33.324844 21.061066)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHpcrr8r_87"></use>
    <use xlink:href="#GLYPHpcrr8r_105" x="6.000092"></use>
    <use xlink:href="#GLYPHpcrr8r_100" x="12.000185"></use>
    <use xlink:href="#GLYPHpcrr8r_116" x="18.000277"></use>
    <use xlink:href="#GLYPHpcrr8r_104" x="24.000369"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,81.145645 21.061066)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmmi10_61"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,89.115753 21.061066)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHpcrr8r_72"></use>
    <use xlink:href="#GLYPHpcrr8r_101" x="6.000092"></use>
    <use xlink:href="#GLYPHpcrr8r_105" x="12.000185"></use>
    <use xlink:href="#GLYPHpcrr8r_103" x="18.000277"></use>
    <use xlink:href="#GLYPHpcrr8r_104" x="24.000369"></use>
    <use xlink:href="#GLYPHpcrr8r_116" x="30.000462"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,150.928635 21.061066)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmmi10_60"></use>
  </g>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,167.754303 21.061066)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmr10_51"></use>
  </g>
</svg></span>
For a rectangular object deviating from this criterion, its longer
side dominates the determination of its pose. This causes
instability in the estimation of the angle around the longer
rectangle's axis. In the extreme case when one of the dimensions is
0, the rectangle is in fact a line segment, whose pose cannot be
estimated.
</p>
<p>Secondly, the <b>lengths of each side of the contour</b> should be
at least 20 pixels. An error is returned if a side of the contour is
less than 5 pixels long.
</p>
<p>Thirdly, the more the contour appears <b>projectively
distorted</b>, the more stable the algorithm works. Therefore, the pose
of a rectangle tilted with respect to the image plane can be estimated
accurately, whereas the pose of an rectangle parallel to the image
plane of the camera could be unstable. This is further discussed in
the next paragraph. Additionally, there is a rule of thumb that
ensures projective distortion: the rectangle should be placed in
space such that its size in x and y dimension in the camera
coordinate system should not be less than 1/10th of its distance
from the camera in z direction.
</p>
<p><code><span data-if="hdevelop" style="display:inline">get_rectangle_pose</span><span data-if="c" style="display:none">get_rectangle_pose</span><span data-if="cpp" style="display:none">GetRectanglePose</span><span data-if="com" style="display:none">GetRectanglePose</span><span data-if="dotnet" style="display:none">GetRectanglePose</span><span data-if="python" style="display:none">get_rectangle_pose</span></code> provides two measures for the accuracy of
the estimated <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a>. <a href="#Error"><i><code><span data-if="hdevelop" style="display:inline">Error</span><span data-if="c" style="display:none">Error</span><span data-if="cpp" style="display:none">Error</span><span data-if="com" style="display:none">Error</span><span data-if="dotnet" style="display:none">error</span><span data-if="python" style="display:none">error</span></code></i></a> is the average pixel
error between the contour points and the modeled rectangle
backprojected on the image. If <a href="#Error"><i><code><span data-if="hdevelop" style="display:inline">Error</span><span data-if="c" style="display:none">Error</span><span data-if="cpp" style="display:none">Error</span><span data-if="com" style="display:none">Error</span><span data-if="dotnet" style="display:none">error</span><span data-if="python" style="display:none">error</span></code></i></a> is exceeding 0.5, this
is an indication that the algorithm did not converge properly, and
the resulting <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a> should not be used. <a href="#CovPose"><i><code><span data-if="hdevelop" style="display:inline">CovPose</span><span data-if="c" style="display:none">CovPose</span><span data-if="cpp" style="display:none">CovPose</span><span data-if="com" style="display:none">CovPose</span><span data-if="dotnet" style="display:none">covPose</span><span data-if="python" style="display:none">cov_pose</span></code></i></a>
contains 36 entries representing the  6×6 
covariance matrix of the first 6 entries of <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a>. The above
mentioned case of instability of the angle about the longer
rectangle's axis be detected by checking that the absolute values of
the variances and covariances of the rotations around the x and
y axis (<a href="#CovPose"><i><code><span data-if="hdevelop" style="display:inline">CovPose</span><span data-if="c" style="display:none">CovPose</span><span data-if="cpp" style="display:none">CovPose</span><span data-if="com" style="display:none">CovPose</span><span data-if="dotnet" style="display:none">covPose</span><span data-if="python" style="display:none">cov_pose</span></code></i></a>[21],<a href="#CovPose"><i><code><span data-if="hdevelop" style="display:inline">CovPose</span><span data-if="c" style="display:none">CovPose</span><span data-if="cpp" style="display:none">CovPose</span><span data-if="com" style="display:none">CovPose</span><span data-if="dotnet" style="display:none">covPose</span><span data-if="python" style="display:none">cov_pose</span></code></i></a>[28], and
<a href="#CovPose"><i><code><span data-if="hdevelop" style="display:inline">CovPose</span><span data-if="c" style="display:none">CovPose</span><span data-if="cpp" style="display:none">CovPose</span><span data-if="com" style="display:none">CovPose</span><span data-if="dotnet" style="display:none">covPose</span><span data-if="python" style="display:none">cov_pose</span></code></i></a>[22] == <a href="#CovPose"><i><code><span data-if="hdevelop" style="display:inline">CovPose</span><span data-if="c" style="display:none">CovPose</span><span data-if="cpp" style="display:none">CovPose</span><span data-if="com" style="display:none">CovPose</span><span data-if="dotnet" style="display:none">covPose</span><span data-if="python" style="display:none">cov_pose</span></code></i></a>[27]) do not exceed
0.05. Further, unusually increased values of any of the covariances
and especially of the variances (the 6 values on the diagonal of
<a href="#CovPose"><i><code><span data-if="hdevelop" style="display:inline">CovPose</span><span data-if="c" style="display:none">CovPose</span><span data-if="cpp" style="display:none">CovPose</span><span data-if="com" style="display:none">CovPose</span><span data-if="dotnet" style="display:none">covPose</span><span data-if="python" style="display:none">cov_pose</span></code></i></a> with indices 0, 7, 14, 21, 28 and 35, respectively)
indicate a poor quality of <a href="#Pose"><i><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></i></a>.</p>
<h2 id="sec_execution">运行信息</h2>
<ul>
  <li>多线程类型:可重入(与非独占操作符并行运行)。</li>
<li>多线程作用域:全局(可以从任何线程调用)。</li>
  <li>未经并行化处理。</li>
</ul>
<h2 id="sec_parameters">参数表</h2>
  <div class="par">
<div class="parhead">
<span id="Contour" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Contour</span><span data-if="c" style="display:none">Contour</span><span data-if="cpp" style="display:none">Contour</span><span data-if="com" style="display:none">Contour</span><span data-if="dotnet" style="display:none">contour</span><span data-if="python" style="display:none">contour</span></code></b> (input_object)  </span><span>xld(-array) <code>→</code> <span data-if="hdevelop" style="display:inline">object</span><span data-if="dotnet" style="display:none"><a href="HXLD.html">HXLD</a></span><span data-if="python" style="display:none">HObject</span><span data-if="cpp" style="display:none"><a href="HXLD.html">HXLD</a></span><span data-if="c" style="display:none">Hobject</span></span>
</div>
<p class="pardesc">Contour(s) to be examined.</p>
</div>
  <div class="par">
<div class="parhead">
<span id="CameraParam" class="parname"><b><code><span data-if="hdevelop" style="display:inline">CameraParam</span><span data-if="c" style="display:none">CameraParam</span><span data-if="cpp" style="display:none">CameraParam</span><span data-if="com" style="display:none">CameraParam</span><span data-if="dotnet" style="display:none">cameraParam</span><span data-if="python" style="display:none">camera_param</span></code></b> (input_control)  </span><span>campar <code>→</code> <span data-if="dotnet" style="display:none"><a href="HCamPar.html">HCamPar</a>, </span><span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Sequence[Union[int, float, str]]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real / </span><span data-if="hdevelop" style="display:inline">integer / </span><span data-if="hdevelop" style="display:inline">string)</span><span data-if="dotnet" style="display:none"> (<i>double</i> / </span><span data-if="dotnet" style="display:none">int / </span><span data-if="dotnet" style="display:none">long / </span><span data-if="dotnet" style="display:none">string)</span><span data-if="cpp" style="display:none"> (<i>double</i> / </span><span data-if="cpp" style="display:none">Hlong / </span><span data-if="cpp" style="display:none">HString)</span><span data-if="c" style="display:none"> (<i>double</i> / </span><span data-if="c" style="display:none">Hlong / </span><span data-if="c" style="display:none">char*)</span></span>
</div>
<p class="pardesc">Internal camera parameters.</p>
</div>
  <div class="par">
<div class="parhead">
<span id="Width" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Width</span><span data-if="c" style="display:none">Width</span><span data-if="cpp" style="display:none">Width</span><span data-if="com" style="display:none">Width</span><span data-if="dotnet" style="display:none">width</span><span data-if="python" style="display:none">width</span></code></b> (input_control)  </span><span>number(-array) <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">MaybeSequence[float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">Width of the rectangle in meters.</p>
<p class="pardesc"><span class="parcat">Restriction:
      </span><code>Width &gt; 0</code></p>
</div>
  <div class="par">
<div class="parhead">
<span id="Height" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Height</span><span data-if="c" style="display:none">Height</span><span data-if="cpp" style="display:none">Height</span><span data-if="com" style="display:none">Height</span><span data-if="dotnet" style="display:none">height</span><span data-if="python" style="display:none">height</span></code></b> (input_control)  </span><span>number(-array) <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">MaybeSequence[float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">Height of the rectangle in meters.</p>
<p class="pardesc"><span class="parcat">Restriction:
      </span><code>Height &gt; 0</code></p>
</div>
  <div class="par">
<div class="parhead">
<span id="WeightingMode" class="parname"><b><code><span data-if="hdevelop" style="display:inline">WeightingMode</span><span data-if="c" style="display:none">WeightingMode</span><span data-if="cpp" style="display:none">WeightingMode</span><span data-if="com" style="display:none">WeightingMode</span><span data-if="dotnet" style="display:none">weightingMode</span><span data-if="python" style="display:none">weighting_mode</span></code></b> (input_control)  </span><span>string <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">str</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (string)</span><span data-if="dotnet" style="display:none"> (<i>string</i>)</span><span data-if="cpp" style="display:none"> (<i>HString</i>)</span><span data-if="c" style="display:none"> (<i>char*</i>)</span></span>
</div>
<p class="pardesc">Weighting mode for the optimization phase.</p>
<p class="pardesc"><span class="parcat">Default:
      </span>
    <span data-if="hdevelop" style="display:inline">'nonweighted'</span>
    <span data-if="c" style="display:none">"nonweighted"</span>
    <span data-if="cpp" style="display:none">"nonweighted"</span>
    <span data-if="com" style="display:none">"nonweighted"</span>
    <span data-if="dotnet" style="display:none">"nonweighted"</span>
    <span data-if="python" style="display:none">"nonweighted"</span>
</p>
<p class="pardesc"><span class="parcat">List of values:
      </span><span data-if="hdevelop" style="display:inline">'huber'</span><span data-if="c" style="display:none">"huber"</span><span data-if="cpp" style="display:none">"huber"</span><span data-if="com" style="display:none">"huber"</span><span data-if="dotnet" style="display:none">"huber"</span><span data-if="python" style="display:none">"huber"</span>, <span data-if="hdevelop" style="display:inline">'nonweighted'</span><span data-if="c" style="display:none">"nonweighted"</span><span data-if="cpp" style="display:none">"nonweighted"</span><span data-if="com" style="display:none">"nonweighted"</span><span data-if="dotnet" style="display:none">"nonweighted"</span><span data-if="python" style="display:none">"nonweighted"</span>, <span data-if="hdevelop" style="display:inline">'tukey'</span><span data-if="c" style="display:none">"tukey"</span><span data-if="cpp" style="display:none">"tukey"</span><span data-if="com" style="display:none">"tukey"</span><span data-if="dotnet" style="display:none">"tukey"</span><span data-if="python" style="display:none">"tukey"</span></p>
</div>
  <div class="par">
<div class="parhead">
<span id="ClippingFactor" class="parname"><b><code><span data-if="hdevelop" style="display:inline">ClippingFactor</span><span data-if="c" style="display:none">ClippingFactor</span><span data-if="cpp" style="display:none">ClippingFactor</span><span data-if="com" style="display:none">ClippingFactor</span><span data-if="dotnet" style="display:none">clippingFactor</span><span data-if="python" style="display:none">clipping_factor</span></code></b> (input_control)  </span><span>number <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">float</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">Clipping factor for the elimination of outliers
(typical: <i>1.0</i> for <i><span data-if="hdevelop" style="display:inline">'huber'</span><span data-if="c" style="display:none">"huber"</span><span data-if="cpp" style="display:none">"huber"</span><span data-if="com" style="display:none">"huber"</span><span data-if="dotnet" style="display:none">"huber"</span><span data-if="python" style="display:none">"huber"</span></i> and
<i>3.0</i> for <i><span data-if="hdevelop" style="display:inline">'tukey'</span><span data-if="c" style="display:none">"tukey"</span><span data-if="cpp" style="display:none">"tukey"</span><span data-if="com" style="display:none">"tukey"</span><span data-if="dotnet" style="display:none">"tukey"</span><span data-if="python" style="display:none">"tukey"</span></i>).</p>
<p class="pardesc"><span class="parcat">Default:
      </span>2.0</p>
<p class="pardesc"><span class="parcat">Suggested values:
      </span>1.0, 1.5, 2.0, 2.5, 3.0</p>
<p class="pardesc"><span class="parcat">Restriction:
      </span><code>ClippingFactor &gt; 0</code></p>
</div>
  <div class="par">
<div class="parhead">
<span id="Pose" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Pose</span><span data-if="c" style="display:none">Pose</span><span data-if="cpp" style="display:none">Pose</span><span data-if="com" style="display:none">Pose</span><span data-if="dotnet" style="display:none">pose</span><span data-if="python" style="display:none">pose</span></code></b> (output_control)  </span><span>pose(-array) <code>→</code> <span data-if="dotnet" style="display:none"><a href="HPose.html">HPose</a>, </span><span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Sequence[Union[int, float]]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real / </span><span data-if="hdevelop" style="display:inline">integer)</span><span data-if="dotnet" style="display:none"> (<i>double</i> / </span><span data-if="dotnet" style="display:none">int / </span><span data-if="dotnet" style="display:none">long)</span><span data-if="cpp" style="display:none"> (<i>double</i> / </span><span data-if="cpp" style="display:none">Hlong)</span><span data-if="c" style="display:none"> (<i>double</i> / </span><span data-if="c" style="display:none">Hlong)</span></span>
</div>
<p class="pardesc">3D pose of the rectangle.</p>
<p class="pardesc"><span class="parcat">Number of elements:
      </span>Pose == 7 * Contour</p>
</div>
  <div class="par">
<div class="parhead">
<span id="CovPose" class="parname"><b><code><span data-if="hdevelop" style="display:inline">CovPose</span><span data-if="c" style="display:none">CovPose</span><span data-if="cpp" style="display:none">CovPose</span><span data-if="com" style="display:none">CovPose</span><span data-if="dotnet" style="display:none">covPose</span><span data-if="python" style="display:none">cov_pose</span></code></b> (output_control)  </span><span>number-array <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Sequence[float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">Covariances of the pose values.</p>
<p class="pardesc"><span class="parcat">Number of elements:
      </span>CovPose == 36 * Contour</p>
</div>
  <div class="par">
<div class="parhead">
<span id="Error" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Error</span><span data-if="c" style="display:none">Error</span><span data-if="cpp" style="display:none">Error</span><span data-if="com" style="display:none">Error</span><span data-if="dotnet" style="display:none">error</span><span data-if="python" style="display:none">error</span></code></b> (output_control)  </span><span>number-array <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Sequence[float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">Root-mean-square value of the final residual error.</p>
<p class="pardesc"><span class="parcat">Number of elements:
      </span>Error == Contour</p>
</div>
<h2 id="sec_example_all">例程 (HDevelop)</h2>
<pre class="example">
* Process an image with several rectangles of the same size appearing
* as light objects.
RectWidth := 0.04
RectHeight := 0.025
gen_cam_par_area_scan_division (0.014, 830, 4.58e-006, 4.65e-006, \
                                509, 488, 800, 800, CameraParam)
read_image (Image, 'barcode/ean13/tea_box_01')
* Find light objects in the image.
mean_image (Image, ImageMean, 201, 201)
dyn_threshold (Image, ImageMean, Region, 5, 'light')
* Fill gaps in the objects.
fill_up (Region, RegionFillUp)
* Extract rectangular contours.
connection (RegionFillUp, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, ['area','rectangularity'], \
              'and', [50000,0.9], [640000,1])
boundary (SelectedRegions, RegionBorder, 'inner')
dilation_circle (RegionBorder, RegionDilation, 3.5)
* NOTE: for a real application, this step might require some additional
*       pre- or postprocessing.
reduce_domain (Image, RegionDilation, ImageReduced)
edges_sub_pix (ImageReduced, Edges, 'canny', 1, 20, 40)
* Get the pose of all contours found.
get_rectangle_pose (Edges, CameraParam, RectWidth, RectHeight, 'huber', 2, \
                    Poses, CovPose, Error)
NumPoses := |Poses|/7
for I := 0 to NumPoses-1 by 1
  Pose := Poses[I*7:I*7+6]
  * Use the Pose here.
  * ...
endfor
</pre>
<h2 id="sec_result">结果</h2>
<p><code><span data-if="hdevelop" style="display:inline">get_rectangle_pose</span><span data-if="c" style="display:none">get_rectangle_pose</span><span data-if="cpp" style="display:none">GetRectanglePose</span><span data-if="com" style="display:none">GetRectanglePose</span><span data-if="dotnet" style="display:none">GetRectanglePose</span><span data-if="python" style="display:none">get_rectangle_pose</span></code> returns <TT>2</TT> (
      <TT>H_MSG_TRUE</TT>)
     if all parameter values are
correct and the position of the rectangle has been determined
successfully. If the provided contour(s) cannot be segmented as a
quadrangle <code><span data-if="hdevelop" style="display:inline">get_rectangle_pose</span><span data-if="c" style="display:none">get_rectangle_pose</span><span data-if="cpp" style="display:none">GetRectanglePose</span><span data-if="com" style="display:none">GetRectanglePose</span><span data-if="dotnet" style="display:none">GetRectanglePose</span><span data-if="python" style="display:none">get_rectangle_pose</span></code> returns
H_ERR_FIT_QUADRANGLE. If further necessary, an exception is
raised.</p>
<h2 id="sec_predecessors">可能的前置算子</h2>
<p>
<code><a href="edges_sub_pix.html"><span data-if="hdevelop" style="display:inline">edges_sub_pix</span><span data-if="c" style="display:none">edges_sub_pix</span><span data-if="cpp" style="display:none">EdgesSubPix</span><span data-if="com" style="display:none">EdgesSubPix</span><span data-if="dotnet" style="display:none">EdgesSubPix</span><span data-if="python" style="display:none">edges_sub_pix</span></a></code>
</p>
<h2 id="sec_see">参考其它</h2>
<p>
<code><a href="get_circle_pose.html"><span data-if="hdevelop" style="display:inline">get_circle_pose</span><span data-if="c" style="display:none">get_circle_pose</span><span data-if="cpp" style="display:none">GetCirclePose</span><span data-if="com" style="display:none">GetCirclePose</span><span data-if="dotnet" style="display:none">GetCirclePose</span><span data-if="python" style="display:none">get_circle_pose</span></a></code>, 
<code><a href="set_origin_pose.html"><span data-if="hdevelop" style="display:inline">set_origin_pose</span><span data-if="c" style="display:none">set_origin_pose</span><span data-if="cpp" style="display:none">SetOriginPose</span><span data-if="com" style="display:none">SetOriginPose</span><span data-if="dotnet" style="display:none">SetOriginPose</span><span data-if="python" style="display:none">set_origin_pose</span></a></code>, 
<code><a href="camera_calibration.html"><span data-if="hdevelop" style="display:inline">camera_calibration</span><span data-if="c" style="display:none">camera_calibration</span><span data-if="cpp" style="display:none">CameraCalibration</span><span data-if="com" style="display:none">CameraCalibration</span><span data-if="dotnet" style="display:none">CameraCalibration</span><span data-if="python" style="display:none">camera_calibration</span></a></code>
</p>
<h2 id="sec_references">References</h2>
<p>

G.Schweighofer and A.Pinz: “Robust Pose Estimation from a Planar
Target”; Transactions on Pattern Analysis and Machine Intelligence
(PAMI), 28(12):2024-2030, 2006
</p>
<h2 id="sec_module">模块</h2>
<p>
3D Metrology</p>
<!--OP_REF_FOOTER_START-->
<hr>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<div class="footer">
<div class="copyright">HALCON算子参考手册 Copyright © 2015-2023 51Halcon</div>
</div>
</div>
</body>
</html>
